import time
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template

class MainPage(webapp.RequestHandler):

    def get(self):
        self.response.headers['Content-Type'] = 'text/html'       
        t = time.localtime()
        context = {
            'hour' : t.tm_hour,
            'minute' : t.tm_min,
            'second' : t.tm_sec
        }
        self.response.out.write(template.render('index.html', context))

application = webapp.WSGIApplication(
    [('/', MainPage)],
    debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
